<!--#include file="common_head.html"-->

<div class="dux-slideshow banner" uk-slideshow="min-height: 250; max-height: 250">
    <ul class="uk-slideshow-items">
        <!--loop{$info.images as $vo}-->
        <li>
            <img src="{$vo.url}" uk-cover>
        </li>
        <!--{/loop}-->
    </ul>
    <ul class="uk-slideshow-nav uk-dotnav uk-flex-center"></ul>
</div>

<main class="dux-main">
    <div class="dux-box dux-pro-info">
        <h1 class="info-title">
            {$info.title}
        </h1>
        <div class="info-price">
            <h2>￥{$proInfo.sell_price}</h2><small>￥{$proInfo.market_price}</small>
        </div>
    </div>

    <ul class="dux-box dux-pro-data uk-grid uk-grid-collapse  uk-child-width-expand">
        <li>
            销量 <span>{$info.sale}</span>
        </li>
        <li>
            评论 <span>{$info.comments}</span>
        </li>
        <li>
            收藏 <span>{$info.favorite}</span>
        </li>
    </ul>

    <div class="dux-box dux-pro-spec">
        <div  class="spec-list">
        <div data-dux="shop-sku">
            <!--loop{$specList as $vo}-->
            <dl>
            <dt>
                {$vo.name}
            </dt>
            <dd>
                <!--loop{$vo.value as $v}-->
                <!--if{$v == $vo.cur}-->
                <a href="javascript:;" class="active" data-id="{$vo.id}" data-name="{$vo.name}" data-value="{$v}">
                    <!--{else}-->
                    <a href="javascript:;" data-id="{$vo.id}" data-name="{$vo.name}" data-value="{$v}">
                        <!--{/if}-->
                        {$v}</a>
                    <!--{/loop}-->
            </dd>
            </dl>
            <!--{/loop}-->
        </div>

            <dl>
                <dt>数量</dt>
                <dd class="content">
                    <div class="shop-count" data-count="{$proInfo.store}" data-dux="shop-count">
                        <span class="down">-</span>
                        <input type="tel" value="1" name="count" id="count">
                        <span class="up">+</span>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>库存</dt>
                <dd class="content">
                    {$proInfo.store} {$info.unit}
                </dd>
            </dl>
        </div>
    </div>

    <div class="dux-box dux-pro-spec">
        <div  class="spec-list">
            <dl>
                <dt>品牌</dt>
                <dd class="content">
                    {$brandInfo.name ? $brandInfo.name : '未知'}
                </dd>
            </dl>
            <dl>
                <dt>出产地</dt>
                <dd class="content">
                    {$info.from_province ? $info.from_province.' '.$info.from_city.' '.$info.from_region : '未知'}
                </dd>
            </dl>
        </div>

    </div>



    <ul class="dux-pro-menu">
        <li>
            <a href="{url('content', ['id' => $info.mall_id])}">
                商品详情
            </a>
        </li>
        <li>
            <a href="{url('shop/comment/index', ['id' => $info.mall_id, 'app' => 'mall'])}">
                商品评价  ({$info.comments})
            </a>
        </li>
    </ul>
    <div class="dux-pro-action-fixed">
    <div class="dux-pro-action">
        <div class="action-info">
            <a href="javascript:;" data-dux="shop-follow" data-url="{url('mall/Mall/addFollow')}" data-params='{"mall_id" : {$info.mall_id}}' data-status="{$info.follow}">
                <i class="{$info.follow ? 'fa fa-heart' : 'fa fa-heart-o'}" data-icon></i>
                <div class="title">收藏</div>
            </a>
            <a href="{url('order/Cart/index')}">
                <i class="fa fa-shopping-cart"></i>
                <div class="title">购物车</div>
                <span class="uk-label uk-label-danger" id="cart-num">0</span>
            </a>
        </div>
        <div class="action-btn">
            <!--if{$info.status}-->
            <a href="javascript:;" data-url="{url('mall/Mall/addCart')}"
               data-params='{"pro_id" : {$proInfo.products_id}}' data-count="#count"
               data-dux="shop-addCart" class="btn-add" data-callback="refreshCart">
                加入购物车
            </a>
            <a href="javascript:;" data-url="{url('mall/Mall/buyCart')}"
               data-params='{"pro_id" : {$proInfo.products_id}}' data-count="#count"
               data-dux="shop-addCart" class="btn-submit" data-callback="refreshCart">
                立即购买
            </a>
            <!--{else}-->
            <a href="javascript:;" class="btn-add">
                商品已下架
            </a>
            <!--{/if}-->
        </div>
    </div>
    </div>

</main>

<span class="dux-totop" uk-totop uk-scroll></span>

<!--#include file="common_foot.html"-->

<script>
    var productJson = {json_encode($skuList)};
    Do('base', function () {
        window.refreshCart = function () {
            app.ajax({
                url : "{url('order/Cart/getJson')}",
                type : 'post',
                success : function (info) {
                    $('#cart-num').text(info.items ? info.items : 0);
                },
                login : function () {
                }
            });
        };
        refreshCart();
    });
</script>
</html>

</html>